package com.zhentao.controller;

import com.zhentao.AdWithdrawal.dto.AdWithdrawalDto;
import com.zhentao.common.dtos.ResponseResult;
import com.zhentao.service.AdWithdrawalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api("/后台对于提现请求的处理")
@RestController
@RequestMapping("/moneyManage")
public class AdWithdrawal {

    @Resource
    private AdWithdrawalService adWithdrawalService;

    /**
     * 后台 查询所有需要提现的请求
     * @param dto
     * @return
     */

    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", dataType = "AdWithdrawalDto", name = "dto", value = "", required = true)
    })
    @ApiOperation(value = "后台 查询所有需要提现的请求", notes = "后台 查询所有需要提现的请求", httpMethod = "POST")
    @PostMapping("/AdMoneyUserList")
    public ResponseResult moneyUserList(@RequestBody AdWithdrawalDto dto){
    	return adWithdrawalService.moneyUserList(dto);
    }

    /**
     * 后台 审核
     * 提现请求状态0待处理1已批准2已拒绝
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", dataType = "AdWithdrawal", name = "adWithdrawal", value = "", required = true)
    })
    @ApiOperation(value = "后台 审核 提现请求状态0待处理1已批准2已拒绝", notes = "后台 审核 提现请求状态0待处理1已批准2已拒绝", httpMethod = "POST")
    @PostMapping("/upMoneyStatus")
    public ResponseResult upMoneyStatus(@RequestBody com.zhentao.AdWithdrawal.domain.AdWithdrawal adWithdrawal){
    	return adWithdrawalService.upMoneyStatus(adWithdrawal);
    }

}
